package cn.wx.feignClient;


import cn.wx.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// 指定需要调用的服务的应用名称
@FeignClient(name = "user-server", fallbackFactory = UserFallbackFactory.class)
public interface UserFeignClient  {

    /*
     *   1.方法名称必须跟被代理方接口一致
     *   2.接口的参数和返回值必须跟代理方一致
     *   3.接口的请求方式必须跟代理方一致
     *   4.总结：直接c方法
     *
     * */

    @GetMapping("/user/{id}")
    public User getUser(@PathVariable Long id );


}
